home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
DINKDEMO
/
DINKCLAS
/
DEVENTHA.C
< prev
next >
Wrap
Text File
|
1992-07-08
|
2KB
|
125 lines
/*
File: DEventHandler.c
Written by: Mark Gross
Copyright: ⌐ 1992 by Applied Technical Software, all rights reserved.
Use at your own risk.
*/
#include "DEventHandler.h"
#include "DApplication.h"
DApplication* DEventHandler::gApplication = NULL;
Boolean DEventHandler::gPassItOn = TRUE;
DEventHandler::DEventHandler(void)
{
fNextHandler = NULL;
fAlive = TRUE;
if(gApplication)
gApplication->InstalHandler(this);
}
DEventHandler::~DEventHandler(void)
{
}
void DEventHandler::KillMeNext(void)
{
gApplication->RemoveHandler( this);
fAlive = FALSE;
}
void DEventHandler:: HandleNullEvent(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleNullEvent(theEvent);
}
void DEventHandler:: HandleActivateEvt(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleActivateEvt(theEvent);
}
void DEventHandler:: HandleAutoKey(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleAutoKey(theEvent);
}
void DEventHandler:: HandleKeyDown(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleKeyDown(theEvent);
}
void DEventHandler:: HandleDiskEvt(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleDiskEvt(theEvent);
}
void DEventHandler:: HandleHighLevelEvent(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleHighLevelEvent(theEvent);
}
void DEventHandler:: HandleOSEvent(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleOSEvent(theEvent);
}
void DEventHandler:: HandleUpdateEvt(EventRecord *theEvent)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleUpdateEvt(theEvent);
}
void DEventHandler::HandleMouseDown(EventRecord *theEvent, short thePart, WindowPtr theWindow)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleMouseDown(theEvent, thePart, theWindow);
}
void DEventHandler::HandleMenuChoice(short menuID, short menuItem)
{
if (gPassItOn && fNextHandler)
fNextHandler->HandleMenuChoice(menuID, menuItem);
}
void DEventHandler::EnableMenuItem(MenuHandle menu, short item, Boolean enable)
{
if (enable)
EnableItem(menu, item);
else
DisableItem(menu, item);
}//
void DEventHandler::SetUpMenues(void)
{
if (gPassItOn && fNextHandler)
fNextHandler->SetUpMenues();
}